import GameData from "./GameData";

/**
 * @Author: 陈瑞鹏
 * @Date:   2022-10-31 18:45:42
 * @Last Modified by:   陈瑞鹏
 * @Last Modified time: 2022-11-11 16:55:05
 */
const { ccclass, property } = cc._decorator;
@ccclass
/**
 * 飘落的钱的脚本
 */
export default class MoneyDownEle extends cc.Component {

  protected onEnable(): void {
    this.node.angle = Math.random() * 180;
    cc.tween(this.node)
      .to(2, { x: Math.random() * 800 - 400, y: -700 })
      .call(() => {
        GameData.ins.moneyPool.put(this.node);
      })
      .start();
  }
}